#include "SaveImage.h"
#include "../utils/Logger.h"

SaveImage::SaveImage(const string &filename) :
        filename(filename)
{
}

SaveImage::~SaveImage() {
}

IplImage* SaveImage::apply(const IplImage* in) {
    Log << "Applying save image effect: " << filename << endl;

    cvSaveImage(filename.c_str(), in);

    IplImage *out = cvCreateImage(cvSize(in->width, in->height), in->depth, in->nChannels);
    cvCopy(in, out);
    return out;
}
